Skip to content

Implement conditional Cocoa linking for targets #421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Jul 11, 2025

📜 Description

Moved Sentry Cocoa framework linking configuration to execute only when Apple targets are present in the Gradle task graph. This prevents unnecessary execution of Cocoa-specific logic for non-Apple builds

💡 Motivation and Context

Previously, the plugin would eagerly configure Cocoa framework linking on macOS, even if the build only involved Android or JVM targets. This could lead to build failures if the Sentry Cocoa XCFramework was not found, despite not being needed. This change ensures the linking setup is deferred and only runs when relevant, improving build robustness and efficiency for mixed-platform projects.

💚 How did you test it?

Integration test

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.

🔮 Next steps

@buenaflor buenaflor requested a review from romtsn as a code owner July 11, 2025 12:09
@buenaflor buenaflor marked this pull request as draft July 11, 2025 12:09
@buenaflor buenaflor changed the title Implement conditional Cocoa linking for targets [DRAFT] Implement conditional Cocoa linking for targets Jul 11, 2025
Copy link

codecov bot commented Jul 14, 2025

Codecov Report

Attention: Patch coverage is 13.33333% with 26 lines in your changes missing coverage. Please review.

Project coverage is 75.29%. Comparing base (89115e0) to head (449c203).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...sentry/kotlin/multiplatform/gradle/SentryPlugin.kt 13.33% 24 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
- Coverage   79.32%   75.29%   -4.04%     
==========================================
  Files          11       11              
  Lines         324      344      +20     
  Branches       49       52       +3     
==========================================
+ Hits          257      259       +2     
- Misses         39       57      +18     
  Partials       28       28              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@buenaflor buenaflor marked this pull request as ready for review July 14, 2025 14:20
@buenaflor buenaflor changed the title [DRAFT] Implement conditional Cocoa linking for targets Implement conditional Cocoa linking for targets Jul 14, 2025
@buenaflor
Copy link
Contributor Author

I think the coverage doesn't account for the integration test?

@buenaflor
Copy link
Contributor Author

@romtsn this should be good to go

Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the coverage doesn't account for the integration test?

yeah, I think there's a separate plugin for that. I think you started looking into that for SAGP but we never got around to wrap it up.

LGTM if it works :)

@buenaflor
Copy link
Contributor Author

I think you started looking into that for SAGP but we never got around to wrap it up.

ah right, I'll have a look at that again when I have time

@buenaflor buenaflor merged commit 3a6a14a into main Jul 16, 2025
8 of 10 checks passed
@buenaflor buenaflor deleted the cursor/implement-conditional-cocoa-linking-for-targets-aebb branch July 16, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants